import request from '@/utils/request'
const api_name = '/admin/core/borrower'
export default {
  //带分页的borrower信息查询
  listPage(pageNum, pageSize, keyword) {
    return request({
      url: `${api_name}/list/${pageNum}/${pageSize}`,
      method: 'GET',
      params: { keyword }
    })
  },
  //借款人详情查询
  getBorrowerInfo(borrowerId){
    return request({
      url: `${api_name}/detail/${borrowerId}`,
      method: 'GET'
    })
  },
  //批准借款申请
  approval(approvalForm){
    return request({
      url: `${api_name}/approval`,
      method: 'PUT',
      data: approvalForm
    })
  },
  //查询所有的借款申请
  getBorrowLists(){
    return request({
      url: '/admin/core/borrowInfo/list',
      method: 'GET'
    })
  },
  //根据borrowInfo的id获取详情
  getBorrowDetailById(id){
    return request({
      url: `/admin/core/borrowInfo/detail/${id}`,
      method: 'GET'
    })
  },
  //提交审批数据到后端,生成标的
  approvalLend(borrowInfoApprovalVo){
    return request({
      url: '/admin/core/borrowInfo/approval',
      method: 'POST',
      data: borrowInfoApprovalVo
    })
  }
}
